﻿@inject DataSource Data

<FluentCombobox Items="@Data.People"
                OptionValue="@(i => i.PersonId.ToString())"
                @bind-SelectedOption=@Person>
    <OptionTemplate>
        <FluentIcon Value="@(new Icons.Regular.Size16.Person())" Slot="end" OnClick="@(() => DemoLogger.WriteLine($"Icon for {@context.LastName} selected"))" />
        @context.FirstName (@context.LastName)
    </OptionTemplate>
</FluentCombobox>
<p>
    Selected: @Person?.FirstName (@Person?.LastName)
</p>

@code {
    public Person Person { get; set; } = default!;
}